package jiali.test.easyfactory_2;

public class CashFactory {

    public static CashSuper createCashSuper(String type) {
        CashSuper cashSuper = null;
        switch (type) {
            case "1":
                cashSuper = new CashNormal();
                break;
            case "2":
                cashSuper = new CashRebate(0.8d);
                break;
            case "3":
                cashSuper = new CashReturn(300d, 100d);
                break;
        }
        return cashSuper;
    }

}
